package day04;

import java.util.Scanner;

public class Pracitice1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请选择功能：1.取款 2.存款 3.查询业务 4.退出");
        int input = scanner.nextInt();
        switch (input) {
            case 1:
                System.out.println("取款业务...");
                break;
            case 2:
                System.out.println("存款业务...");
                break;
            case 3:
                System.out.println("查询业务...");
                break;
            case 4:
                System.out.println("退卡...");
                break;
            default:
                System.out.println("指令错误");

                int count = (int) (Math.random() * 100 + 1);
                System.out.println("答案：" + count);
                System.out.println("请输入一个0-100的整数");
                int user = scanner.nextInt();
                while (user != count) {
                    if (user > count) {
                        System.out.println("猜大了");
                    } else {
                        System.out.println("猜小了");
                    }
                    System.out.println("猜吧");
                    user = scanner.nextInt();
                }
                System.out.println("恭喜你猜对了");
        }
        int count1 = (int) (Math.random() * 100 + 1);
        System.out.println("答案" + count1);

        int user1;
        do {
            System.out.println("猜吧");
            user1 = scanner.nextInt();
            if (user1 > count1) {
                System.out.println("猜大了");
            } else if (user1 < count1) {
                System.out.println("猜小了");
            } else {
                System.out.println("恭喜你猜对了");
            }
        } while (user1 != count1);

        for (int i = 0; i < 5; i++) {
            System.out.println("行动是成功的阶梯");

            for (int j = 1; j <= 9; j++) {
                System.out.println(j + "*9=" + j * 9);
            }

            for (int j = 1; j <= 9; j += 2) {
                System.out.println(j + "*9=" + j * 9);
            }
            for (int j = 9; j >= 1; j--) {
                System.out.println(j + "*9=" + j * 9);
            }
        }

    }
}
